package com.shop.cereshop.commons.domain.kuaidi.kd100.order.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * 同城寄件订单状态枚举
 */
public enum BasameCityOrderStatusEnum {
    /**
     * @ApiModelProperty(value = "订单状态，0：下单成功；100：已接单；210：待取件；230：已到店；310：配送中；515：转单改派中；510：订单状态异常（非终态）；520：已完成；；720：订单取消；710：用户取消订单")
     * private Integer status;
     */
    ORDER_SUCCESS(0, "下单成功"),
    ORDER_ACCEPT(100, "已接单"),
    ORDER_WAIT_PICKUP(210, "待取件"),
    ORDER_ARRIVE_STORE(230, "已到店"),
    ORDER_DELIVERING(310, "配送中"),
    ORDER_TRANSFER_ORDER(515, "转单改派中"),
    ORDER_STATUS_ABNORMAL(510, "订单状态异常（非终态）"),
    ORDER_COMPLETE(520, "已完成"),
    ORDER_CANCEL(720, "订单取消"),
    ORDER_USER_CANCEL(710, "用户取消订单");


    @Getter
    @Setter
    private Integer status;
    @Getter
    @Setter
    private String desc;

    BasameCityOrderStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }


    public static String getDescByStatus(Integer status) {
        for (BasameCityOrderStatusEnum value : BasameCityOrderStatusEnum.values()) {
            if (value.getStatus().equals(status)) {
                return value.getDesc();
            }
        }
        return null;
    }

}
